﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ALMDDD.Domain.Core.Events
{
    /// <summary>
    /// 事件存储服务
    /// </summary>
    public class StoredEvent : Event
    {
        /// <summary>
        /// 构造事件存储
        /// </summary>
        /// <param name="event">事件</param>
        /// <param name="data">存储的数据</param>
        /// <param name="user">用户信息</param>
        public StoredEvent(Event @event, string data, string user)
        {
            Id = Guid.NewGuid();
            AggregateId = @event.AggregateId;
            MessageType = @event.MessageType;
            Data = data;
            User = user;
        }
        /// <summary>
        /// 事件存储ID
        /// </summary>
        public Guid Id { get; private set; }
        /// <summary>
        /// 存储的数据
        /// </summary>
        public string Data { get; private set; }
        /// <summary>
        /// 用户信息
        /// </summary>
        public string User { get; private set; }
    }
}
